A full-stack web platform for commissioning custom hand-drawn artwork.
Customers browse the gallery, place orders with reference images, and track progress — all in one place.
- Project Overview
- Tech Stack
- Project Structure
- Prerequisites
- Database Setup
- Backend Setup
- Frontend Setup
- Environment Variables
- Running the Application
- Available Routes
- API Endpoints
- Resetting the Database
DrawingSpot is a commission-based art platform where:
- Customers can register, browse a gallery, place custom drawing orders (with reference image uploads), track order status, and chat with the artist.
- Admins can manage orders, update statuses, upload completed artwork, manage gallery items, and view all user feedback via a dedicated Admin Panel.
- Authentication is handled via JWT tokens with optional Google OAuth sign-in.
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.5, Spring Security, JPA |
| Database | PostgreSQL 16 |
| ORM | Hibernate (via Spring Data JPA) |
| Auth | JWT (jjwt 0.11.5) + Google OAuth 2.0 |
| Frontend | React 19, Vite 7, React Router DOM 7 |
| HTTP Client | Axios |
| Icons | React Icons 5 |
| Build Tool | Maven (backend), npm (frontend) |
DrawingSpot/
├── drawingspot-backend/ # Spring Boot backend
│ ├── src/
│ │ └── main/
│ │ ├── java/com/example/drawingspot/
│ │ │ ├── config/ # Security, CORS, MVC config
│ │ │ ├── controller/ # REST API controllers
│ │ │ ├── exception/ # Global exception handling
│ │ │ ├── model/ # JPA entities
│ │ │ ├── repository/ # Spring Data repositories
│ │ │ ├── service/ # Business logic
│ │ │ └── util/ # JWT utilities
│ │ └── resources/
│ │ └── application.properties
│ ├── uploads/orders/ # Uploaded reference images (auto-created)
│ ├── reset.sql # SQL to drop all tables (dev use)
│ └── pom.xml
│
├── drawingspot-frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── api/ # Axios API call modules
│ │ ├── components/ # Reusable UI components
│ │ │ ├── common/ # CartDrawer, UserChat, etc.
│ │ │ ├── gallery/
│ │ │ ├── home/
│ │ │ ├── layout/ # Navbar, Footer
│ │ │ ├── order/
│ │ │ └── pricing/
│ │ ├── context/ # AuthContext (global auth state)
│ │ ├── pages/ # Full page components
│ │ ├── routes/ # AppRoutes.jsx (central routing)
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── .env # Frontend environment variables
│ ├── vite.config.js
│ └── package.json
│
├── .gitignore
└── README.md
Make sure the following are installed on your machine before starting:
| Tool | Version | Download |
|---|---|---|
| Java (JDK) | 21+ | https://adoptium.net |
| Maven | 3.9+ | https://maven.apache.org/download.cgi |
| Node.js | 18+ | https://nodejs.org |
| npm | 9+ | Comes bundled with Node.js |
| PostgreSQL | 14+ | https://www.postgresql.org/download |
| Git | any | https://git-scm.com |
Tip: Verify installations by running
java -version,mvn -version,node -version, andpsql --versionin a terminal.
Ensure your PostgreSQL server is running (default port 5432).
Open a terminal and run:
psql -U postgresThen inside the psql shell:
CREATE DATABASE drawingspot;
\qIf you want to wipe existing tables and start fresh, run the provided script:
psql -U postgres -d drawingspot -f drawingspot/reset.sql
⚠️ This dropschat_messages,orders, anduserstables — use only in development.
Hibernate will auto-recreate all tables on the next backend start (ddl-auto=update).
git clone https://github.com/forex911/DrawingSpot.git
cd DrawingSpotOpen drawingspot-backend/src/main/resources/application.properties and update the database credentials:
# PostgreSQL connection
spring.datasource.url=jdbc:postgresql://localhost:5432/drawingspot
spring.datasource.username=postgres
spring.datasource.password=YOUR_POSTGRES_PASSWORD
# JWT secret — change this to a long random string in production
jwt.secret=mySecretKeyForDrawingSpotApplication123456
jwt.expiration=3600000🔐 Never commit real passwords to version control. Consider using environment variables or a
.envfile injected at runtime for production deployments.
Navigate into the backend directory and use the Maven wrapper:
cd drawingspot-backend
# On macOS / Linux
./mvnw spring-boot:run
# On Windows (PowerShell / CMD)
.\mvnw.cmd spring-boot:runOr if Maven is installed globally:
mvn spring-boot:runThe backend will start at http://localhost:8080.
Open a browser or use curl:
curl http://localhost:8080/api/pricingYou should receive a JSON response (empty array [] on first run).
cd drawingspot-frontend
npm installCreate (or edit) the .env file inside drawingspot-frontend/:
VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id_hereSee the Google OAuth Setup section below if you don't have a Client ID yet.
npm run devThe frontend will start at http://localhost:5173.
| Property | Description | Default |
|---|---|---|
server.port |
Port the backend runs on | 8080 |
spring.datasource.url |
PostgreSQL JDBC URL | jdbc:postgresql://localhost:5432/drawingspot |
spring.datasource.username |
PostgreSQL username | postgres |
spring.datasource.password |
PostgreSQL password | (set yours) |
jwt.secret |
Secret key for signing JWT tokens | (change in production) |
jwt.expiration |
JWT expiry in milliseconds | 3600000 (1 hour) |
upload.dir |
Directory for uploaded reference images | uploads/orders |
spring.servlet.multipart.max-file-size |
Max file size per upload | 20MB |
| Variable | Description |
|---|---|
VITE_GOOGLE_CLIENT_ID |
Google OAuth 2.0 Client ID |
- Go to Google Cloud Console.
- Create a new project (or select an existing one).
- Navigate to APIs & Services → Credentials.
- Click Create Credentials → OAuth 2.0 Client IDs.
- Set Application type to
Web application. - Add the following Authorized JavaScript origins:
http://localhost:5173(for development)
- Copy the generated Client ID and paste it into
drawingspot-frontend/.env:VITE_GOOGLE_CLIENT_ID=your_client_id_here
Run both servers simultaneously in separate terminals:
Terminal 1 — Backend:
cd DrawingSpot/drawingspot-backend
.\mvnw.cmd spring-boot:runTerminal 2 — Frontend:
cd DrawingSpot/drawingspot-frontend
npm run devThen open http://localhost:5173 in your browser.
| Route | Page | Auth Required |
|---|---|---|
/ |
Home | No |
/pricing |
Pricing Plans | No |
/gallery |
Art Gallery | No |
/order |
Place an Order | No |
/login |
Login | No |
/register |
Register | No |
/how-it-works |
How It Works | No |
/art-buying-guide |
Art Buying Guide | No |
/faqs |
FAQs | No |
/contact |
Contact Us | No |
/shipping-policy |
Shipping Policy | No |
/dashboard |
User Dashboard | ✅ Yes |
/my-orders |
My Orders | ✅ Yes |
/admin |
Admin Panel | ✅ Yes |
All API endpoints are prefixed with /api.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login and receive JWT |
| POST | /api/auth/google |
Google OAuth login |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/orders |
Place a new order (with file upload) |
| GET | /api/orders/user/{userId} |
Get all orders for a user |
| GET | /api/orders |
Get all orders (admin) |
| PUT | /api/orders/{id}/status |
Update order status (admin) |
| POST | /api/orders/{id}/completed-image |
Upload completed artwork (admin) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/gallery |
Get all gallery items |
| POST | /api/gallery |
Add a gallery item (admin) |
| DELETE | /api/gallery/{id} |
Delete a gallery item |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/pricing |
Get all pricing plans |
| POST | /api/pricing |
Add a pricing plan |
| PUT | /api/pricing/{id} |
Update a pricing plan |
| DELETE | /api/pricing/{id} |
Delete a pricing plan |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/chat/messages/{userId} |
Get chat history for a user |
| POST | /api/chat/send |
Send a message |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/feedback |
Submit feedback |
| GET | /api/feedback |
Get all feedback (admin) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/newsletter/subscribe |
Subscribe to newsletter |
To completely reset all tables during development:
psql -U postgres -d drawingspot -f drawingspot/reset.sqlThen restart the backend — Hibernate will recreate the schema automatically.
| Problem | Solution |
|---|---|
Connection refused on backend start |
Ensure PostgreSQL is running on port 5432 |
FATAL: password authentication failed |
Double-check credentials in application.properties |
| Frontend shows blank page | Make sure backend is running on port 8080 |
| Google sign-in fails | Verify VITE_GOOGLE_CLIENT_ID in .env and that localhost:5173 is an allowed origin in Google Cloud Console |
| Image uploads fail | Ensure the drawingspot/uploads/orders/ directory exists and is writable |
Made with ❤️