How can i create an account in the local env and test it

How can create admin account or test create account on my loca ? How can i access the database to see the data saved
3 Replies
kapa.ai
kapa.ai3d ago
Hi @LifeTaker. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To create and test an account in your local environment, and access the database to see the saved data, you can follow these steps: 1. Create an account: Run your Wasp app locally using wasp start. Navigate to the signup page and create an account. If you've set up authentication as described in the Wasp authentication tutorial (https://wasp-lang.dev/docs/tutorial/auth), you should be able to sign up using a username and password. 2. Test the account: After signing up, you should be able to log in with your new credentials. If you've set authRequired: true for certain pages, you can test if you can access those pages when logged in. 3. Create an admin account: By default, Wasp sets isAdmin to true for new users. You can modify this in your User entity definition:
entity User {
// ...
isAdmin Boolean @default(true)
}

entity User {
// ...
isAdmin Boolean @default(true)
}

Source (https://discord.com/channels/686873244791210014/1194794595972829224) 4. Access the database: To view the data saved in your local database, you can use Prisma Studio:
wasp db studio

wasp db studio

This will open Prisma Studio in your browser, where you can see all entities, including the User entity with the accounts you've created. Source (https://wasp-lang.dev/docs/tutorial/auth#update-the-main-page-to-require-auth) 5. Alternative database access: If you're using a PostgreSQL database (which is recommended for development), you can also connect to it using pgAdmin. The connection details can be found in the DATABASE_URL in your .env.server file. Source (https://discord.com/channels/686873244791210014/1216013963528245328) Remember to run wasp db migrate-dev if you make any changes to your entity definitions to update the database schema. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @LifeTaker, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
martinsos
martinsos3d ago
@LifeTaker did Kappa help you here? Seems to me like the advice is good!
LifeTaker
LifeTakerOP2d ago
yeah im just having an error with 404 when i try to create account
Want results from more Discord servers?
Add your server