A simple CRUD application built with React/TypeScript for the frontend and Express/TypeScript for the backend.
- Create, Read, Update, and Delete users
- TypeScript integration for type safety
- React frontend with functional components and hooks
- Express backend with RESTful API endpoints
- In-memory data storage for simplicity
├── src/
│ ├── client/ # Frontend React app
│ │ ├── components/ # React components
│ │ ├── App.tsx # Main React application
│ │ ├── api.ts # API call functions
│ │ ├── index.html # HTML template
│ │ ├── index.tsx # React entry point
│ │ ├── styles.css # CSS styles
│ │ └── types.ts # TypeScript interfaces
│ ├── models/ # Data models
│ │ └── user.ts # User model and in-memory DB
│ ├── routes/ # API routes
│ │ ├── create.ts # Create user route
│ │ ├── delete.ts # Delete user route
│ │ ├── index.ts # Route aggregator
│ │ ├── read.ts # Read user routes
│ │ └── update.ts # Update user route
│ └── index.ts # Express server entry point
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
- Clone the repository
- Install dependencies:
or
npm installyarn install - Copy
.env.exampleto.envand configure as needed - Start the development server:
or
npm run devyarn dev
npm run dev- Runs both frontend and backend in development modenpm run dev:server- Runs only the backend servernpm run dev:client- Runs only the frontend clientnpm run build- Builds the frontend for productionnpm start- Starts the backend server
GET /api/users- Get all usersGET /api/users/:id- Get user by IDPOST /api/users- Create a new userPUT /api/users/:id- Update a userDELETE /api/users/:id- Delete a user
- React
- TypeScript
- Express
- Parcel (bundler)
- Axios
- Dotenv