Backend with TypeScript, Express, and Sequelize, connected to PostgreSQL on Supabase. Provides a scalable and secure RESTful API with CRUD operations, designed for easy environment configuration and database management.
- CRUD operations for managing users.
- Environment variables for easy configuration.
- Supabase for database hosting and management.
- TypeScript for type safety.
- Sequelize as an ORM to interact with the PostgreSQL database.
- CORS handling for cross-origin requests.
- JWT authentication for secure access.
- Node.js (preferably the latest LTS version).
- PostgreSQL database (hosted on Supabase or locally).
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git cd your-repository -
Install dependencies:
npm install
-
Create a
.envfile in the root of the project and add the following environment variables:DATABASE_URL='your-database-url' PORT='your-port' JWT_SECRET='your-secret-key'
-
Run the project:
npm start
npm run start: Compiles TypeScript and starts the server.npm run dev: Runs the server in development mode withnodemonfor auto-reloading.npm run build: Compiles TypeScript into JavaScript.
- POST
/person: Create a new person. - GET
/people: Get all people. - GET
/person/:id: Get a person by ID. - PUT
/person/:id: Update a person by ID. - DELETE
/person/:id: Delete a person by ID.
This project is licensed under the MIT License - see the LICENSE file for details.