- RESTful API for a School Management System
- Features:
- Schedules (for teachers & students)
- Uplodad/Download subject materials
- Fees inequiry
- Grades inequiry
- Code-wise
- Docs - SwaggerHub Link
- Nodejs & Express - JS Runtime & HTTP Server
- PassportJS - Authentication
- Express-Session - Session Manager
Amazon SDK - DBs & EmailsNot used yet- Morgan - Logger
- Jest - API Testing
- Prettier & Eslint - Linting & Formatting
- AWS - IaaS
- Docker - Development Environment
- Docker
- This is strictly required for the Database to work, any local/cloud PostgreSQL database would do the job.
- NodeJS
- After cloning the repo, open a terminal in your favourite IDE:
- Start the DBs
- In a terminal
docker compose -f postgres-compose.yml up
- In a terminal
- Install dependencies
npm install
- Change
.sample.env
to.env
- Run the tests & make sure all of them pass:
npm run test
- Run the app
npm run dev
- API Docs can be visited at
http://localhost:8080/api-docs/
- Docker:
docker compose -f postgres-compose.yml up
for runningPostgreSQL
.docker exec -it postgres-db psql
for getting intopsql
terminal.
- Run specific test
npm run test -- -t '<name>'
- Resetting DB:
- Through
psql
:DROP TABLE <all table names>
DELETE FROM pg_type WHERE typnamespace=2200;
- Trivial
SELECT typname, typnamespace FROM pg_type WHERE typnamespace=2200;
- Through
sequelize
usingumzug
:npm run migration:downAll
- Through
- Access
EC2
instance:- Make sure that the
Security Group
allowsSSH
from your IP. ssh -i "C:\Users\Lenovo\.ssh\<.pem file>" <rest of aws ip>
- Make sure that the
- Access
RDS
instance:psql <postgres_url>
- Use of AWS's Infrastructure as opposed to VPS or a group of containers generally.
- Using Angular for Frontend.
- Not using a proper framework for Backend. (or both FE & BE)
- Use of
PassportJS
for authentication as opposed to 3rd party auth services (e.g. AWS Cognito) & open source ones (e.g. Ory Hydra). - How to store files?
- Server storage ✅ (for now), AWS S3, MinIO, OpenStack Swift
- Validating input (and possibily sanitizing?)
- express-validator (very JS), runtypes, zod ✅ (puerly based on it being most used), others...
- Starting with
sequelize
, then ?eventually? switching tosequelize-typescript
.