Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Backend setup #1

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

feat: Backend setup #1

wants to merge 14 commits into from

Conversation

shabib87
Copy link
Owner

@shabib87 shabib87 commented Aug 16, 2024

TBD

- Set up project structure with src and dist directories
- Configured TypeScript compiler options in tsconfig.json
- Added Express.js server with basic setup
- Configured ESLint and Prettier for code quality
- Verified successful server startup on localhost:3000
created User entity, and generated schema
with Users table
- Created `Habit` entity to manage user habits with a relationship to the `User` entity.
- Updated `User` entity to include a one-to-many relationship with `Habit`.
shabib87 and others added 3 commits August 22, 2024 20:59
- Added `check-node-version` script to package.json to ensure correct Node.js version.
- Updated README.md in habit-tracker-backend with instructions for using nvm and checking Node.js version.
- Added the `Tracker` entity to represent the tracker data.
- Updated the `User` entity to include a one-to-many relationship with the `Tracker` entity.
- Update the `Habit` entity to include a one-to-many relationship with the `Tracker` entity.
- Update database migrations to reflect the changes.
- Added `preinstall` script to source nvm and use the Node.js version specified in .nvmrc.
- This ensures consistency across different development environments by enforcing the use of Node.js version 18.x.
@shabib87 shabib87 changed the title feat: Initialize backend setup with Express and TypeScript feat: Backend setup Aug 31, 2024
- Added ManyToOne relationship with User
- Added OneToMany relationship with Tracker
- Added OneToMany relationship with Reminder
- Updated README.md with available npm scripts.
- Modified database schema and data in data/db.sqlite.
- Updated package-lock.json and package.json with new dependencies and scripts.
- Modified Habit, Reminder, Tracker, and User entities.
- Added new documentation file: docs/DatabaseRelationship.md.
- Added .env.sample for environment configuration.
- Added new directories for DTOs and helper functions.
- Added new migration file: 1725296831430-schema-update.ts.
- created basic `api/users` route with GET method and sample response.
- Modified server setup in `src/bootstrap/server.ts` to include route configurations.
- Added new directories and files for controllers, middlewares, routers, and utils.

This commit sets up the backend server and organizes the project structure for better maintainability.
- Added DatabaseRelationship.md documentation
- Created router.ts for modular route setup
- Updated server.ts to use setupRoutes function
- Implemented CRUD operations in userController.ts
- Added userRepository.ts for database interactions
- Updated user.route.ts to include all CRUD routes
- Modified router.ts to include new routes
- Added habitController.ts for habit-related logic
- Created habit.dto.ts for habit data transfer objects
- Added habitRepository.ts for habit data handling
- Created habit.route.ts for habit-related routes
… dependencies

- Refactored `habitController.ts` to `src/controllers/habit/habitController.ts`
- Created helper functions for user operations:
  - `createUser.ts`
  - `deleteUser.ts`
  - `readUser.ts`
  - `updateUser.ts`
- Moved `userController.ts` to `src/controllers/user/userController.ts`
- Added `jwt.payload.dto.ts` for JWT payload structure
- Updated `user.dto.ts` with new user data structures
- Modified `habitRepository.ts` and `userRepository.ts` for new structure
- Updated routes in `habit.route.ts` and `user.route.ts`
- Added `validateSignup.ts` for signup validation
- Updated `package.json` and `package-lock.json` for new dependencies
- Updated `db.sqlite` with latest schema changes
…signup responses

- Updated createUser.ts to include token expiry info in signup response
- Added loginUser.ts to handle user login and include token expiry info
- Modified userController.ts to support new login and signup logic
- Updated user.dto.ts to include UserLoginDTO
- Modified user.route.ts to add login and signup routes
- Enhanced encrypt.ts to support token generation
- Added validateLogin.ts for login validation
…eware

- Updated `habitController.ts` to integrate new helper functions
- Added helper functions for habit operations:
  - `createHabit.ts`
  - `deleteHabit.ts`
  - `readHabit.ts`
  - `updateHabit.ts`
- Enhanced `auth.middleware.ts` for better token verification
- Updated `habitRepository.ts` to support new CRUD operations
- Modified routing in `habit.route.ts` to include new endpoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant