A simple School/Result management system to improve the operations of Schools within Nigeria
# SmartScore Backend
SmartScore is a comprehensive school result management system. This backend service is built using Node.js, Express, PostgreSQL, and Prisma ORM.
## Project Setup
### Prerequisites
Before you begin, ensure you have the following installed on your machine:
- **Node.js** (v14 or higher)
- **PostgreSQL** (v13 or higher)
- **Git**
- **npm** (comes with Node.js)
### 1. Clone the Repository
Start by cloning the project repository from GitHub:
```bash
git clone
github.com
```
Then navigate into the project directory:
```bash
cd smartscore-backend
```
### 2. Install Dependencies
To install all the project dependencies, run:
```bash
npm install
```
### 3. Set Up Environment Variables
You need to create a `.env` file that holds your environment-specific variables. An example of these variables is provided in `.env.example`.
To quickly create your `.env` file, run:
```bash
npm run setup-env
```
Once the file is created, you can open the `.env` file and replace the placeholder values with your actual configurations.
### 4. Create PostgreSQL Database
Ensure that PostgreSQL is installed and running on your local machine. You can create the `smartscore` database manually by logging into PostgreSQL with the following commands:
```bash
psql -U postgres
CREATE DATABASE smartscore;
```
### 5. Initialize Prisma (ORM)
After setting up the environment and database, run Prisma migration to sync the schema with your PostgreSQL database:
```bash
npx prisma migrate dev --name init
```
This will apply any pending migrations to your database and ensure Prisma is correctly set up.
### 6. Running the Project
Now you're ready to start the development server. Run:
```bash
npm run start
```
The server will start on the port specified in the `.env` file (default is `3000`).
You can access the API by visiting:
```
localhost
```
### 7. Development Mode with Nodemon
If you want the server to re …